[rush-resolver-cache] Fix subpackage cache optimization#5335
Merged
dmichon-msft merged 6 commits intomicrosoft:mainfrom Aug 28, 2025
Merged
[rush-resolver-cache] Fix subpackage cache optimization#5335dmichon-msft merged 6 commits intomicrosoft:mainfrom
dmichon-msft merged 6 commits intomicrosoft:mainfrom
Conversation
D4N14L
approved these changes
Aug 28, 2025
D4N14L
approved these changes
Aug 28, 2025
rush-plugins/rush-resolver-cache-plugin/src/computeResolverCacheFromLockfileAsync.ts
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes an issue where the subpackage cache file was accidentally written empty.
Details
The previous fix wrote the file before the data had been populated, making the optimization produce correct results but be useless.
Updates the caching layer in PnpmShrinkwrapFile to be based on a content hash of the raw shrinkwrap text instead of file path, so that writing a new file will never have caching issues.
Added an explicit API to clear the shrinkwrap cache.
How it was tested
Built and copied into a repository using the feature. Validated resolver cache created correctly.
Impacted documentation
Only the API documentation for PnpmShrinkwrapFile, which doesn't seem to be part of the API.md.